#ifndef CONFIGHOLDER_H
#define CONFIGHOLDER_H

/************************************************************************
 * Copyright (c) 2008 Sergei Stolyarov
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * This file contains implementation of configuration parameters repository,
 * it maintains settings and all other components must ask for settings
 * from manager.
 ************************************************************************/

#include <QString>

class QSettings;

namespace config {
    // some constants
    const QString APPLICATION_NAME("eeetune");
    const QString APPLICATION_VERSION("0.0.1");
}

class ConfigHolder // singleton
{
    //Q_OBJECT

public:
    static ConfigHolder* getInstance();

    // refresh interval
    int refreshInterval();
    void setRefreshInterval(int value);

    // fan speed
    int fanSpeed();
    void setFanSpeed(int value);

    // fan manual mode
    bool fanManual();
    void setFanManual(bool value);

    bool showLedIcons();
    void setShowLedicons(bool show);

    bool allowTemperatureNotifications();
    void setAllowTemperatureNotifications(bool allow);

    int criticalTemperature();
    void setCriticalTemperature(int t);

    QString criticalTemperatureNotification();
    void setCriticalTemperatureNotification(QString text);

private:
    ConfigHolder();

    QSettings* settings;

    static ConfigHolder* instance;
    
};

#endif
